// Docsify相关配置

/* let numMermaid = 0
mermaid.initialize({ startOnLoad: false }) */

window.$docsify = {
  el: '#app',
  repo: null,
  maxLevel: 6,
  loadNavbar: false,
  loadSidebar: true,
  //hideSidebar: true,
  subMaxLevel: 1,
  auto2top: true,
  homepage: 'README.md',
  basePath: '',
  relativePath: true,
  coverpage: true,
  //logo: '/-/images/logo.svg',
  name: '用户手册',
  nameLink: {
    '/en-us/': '#/en-us/iaf/',
    '/zh-cn/': '#/zh-cn/iaf/',
    '/': '#/',
  },
  markdown: {
    /* renderer: {
      code: function (code, lang) {
        if (lang === 'mermaid') {
          return (
            '<div class="mermaid">' +
            mermaid.render('mermaid-svg-' + numMermaid++, code) +
            '</div>'
          )
        }
        return this.origin.code.apply(this, arguments)
      },
    }, */
  },
  themeColor: '',
  alias: {
    // '.*?/awesome':
    //   'https://raw.githubusercontent.com/docsifyjs/awesome-docsify/master/README.md',
    // '.*?/changelog':
    //   'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG.md',
    // '/.*/_navbar.md': '/_navbar.md',
    // '/es/(.*)':
    //   'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1',
    // '/de-de/(.*)':
    //   'https://raw.githubusercontent.com/docsifyjs/docs-de/master/$1',
    // '/ru-ru/(.*)':
    //   'https://raw.githubusercontent.com/docsifyjs/docs-ru/master/$1',
    //'/zh-cn/(.*)': '../',
    '/zh-cn/iaf/(.*)/_sidebar.md': '/zh-cn/iaf/_sidebar.md',
  },
  autoHeader: false,
  executeScript: true,
  noEmoji: true,
  mergeNavbar: true,
  formatUpdated: '{YYYY}-{MM}-{DD} {HH}:{mm}:{ss}',
  externalLinkTarget: '_blank',
  cornerExternalLinkTarget: '_blank',
  externalLinkRel: 'noopener',
  routerMode: 'hash',
  //crossOriginLinks: [],
  //noCompileLinks:[],
  onlyCover: true,
  requestHeaders: {
    'cache-control': 'no-cache',
  },
  ext: '.md',
  fallbackLanguages: ['zh-cn', 'zh', 'en', 'en-US'],
  /* notFoundPage: {
          '/': '_404.md',
          '/en': 'en/_404.md',
        }, */
  topMargin: 10,
  // vueComponents: {
  //   'button-counter': {
  //     template: /* html */ `<button @click="count += 1">You clicked me {{ count }} times</button>`,
  //     data() {
  //       return {
  //         count: 0,
  //       };
  //     },
  //   },
  // },
  search: {
    maxAge: 86400000,
    path: 'auto',
    placeholder: {
      '/': '搜索',
      '/zh-cn/': '搜索',
      '/en-us/': 'Search',
    },
    noData: {
      '/': '找不到结果',
      '/zh-cn/': '找不到结果',
      '/en/': 'No Result',
    },
    depth: 6,
    hideOtherSidebarContent: false,
    namespace: 'hsm-os_docs',
    pathNamespace: ['/zh-cn', '/en-us'],
  },
  copyCode: {
    buttonText: {
      '/zh-cn/': '点击复制',
      '/en-us/': 'Copy to clipboard',
      '/': 'Copy to clipboard',
    },
    errorText: {
      '/zh-cn/': '错误',
      '/en-us/': 'Error',
      '/': 'Error',
    },
    successText: {
      '/zh-cn/': '已复制',
      '/en-us/': 'Copied',
      '/': 'Copied',
    },
  },
  count: {
    countable: true,
    position: 'top',
    margin: '10px',
    float: 'right',
    fontsize: '0.9em',
    color: 'rgb(90,90,90)',
    // FIXME: 解决字数统计国际化问题
    language: lang === 'zh-cn' ? 'chinese' : 'english',
    /* localization: {
            words: '',
            minute: '',
          }, */
    isExpected: true,
  },
  footer: {
    copy: '<span>&copy; 2023</span>',
    auth: 'HollySys',
    pre: '<hr/>',
    class: 'copyright',
  },
  toc: {
    scope: '.markdown-section',
    headings: 'h2,h3,h4',
    title: '本页导读',
    // url中需要忽略的标签id集合
    // ignoreTitles: {
    //   'organiz-mgm': ['organizmgm'],
    //   'titlemanage': ['titlemanage'],
    //   'menu-mgm': ['menumanage'],
    //   'termbank': ['术语表'],
    //   'workplatform': ['工作台'],
    //   'usermgm': ['usermanage'],
    //   'rolemgm': ['rolemanage'],
    //   'api-mgm': ['apimanage'],
    //   'operate-mgm': ['operatemanage'],
    //   'basic-secu-conf': ['basicsecurityconf'],
    //   'datadict': ['datadict'],
    //   'loginpage-mgm': ['loginpagemanage'],
    //   'thememanage': ['thememanage'],
    //   'homepage-conf': ['homepageconf'],
    //   'workmodel': ['workmodel'],
    //   'usergroup': ['usergroup'],
    //   'orderif': ['orderif'],
    //   'importex': ['importex'],
    //   'onlineuser': ['onlineuser'],
    //   'post-mgm': ['postmgm'],
    //   'interface-questions': ['portalques']
    // }
  },
}
